package com.hexinfo.dmpro.monitor.dao;

import com.hexinfo.dmpro.monitor.model.cm.CountResourceInfo;
import com.hexinfo.dmpro.monitor.model.cm.DetailResourceInfo;
import com.hexinfo.dmpro.monitor.model.cm.ImpalaResourceInfo;
import com.hexinfo.dmpro.monitor.model.cm.UtilizationImpalaInfo;
import com.hexinfo.dmpro.monitor.model.cm.ResourceBaseReqModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 **/
@Repository
public interface CmImpalaPoolDao {

    void insertPools(Map<String, Object> map);
    void insertPoolsNow(Map<String, Object> map);
    void deletePoolsNow(Map<String, Object> map);


    List<ImpalaResourceInfo> selImpalaPoolTop(ResourceBaseReqModel req);

    List<ImpalaResourceInfo> selImpalaPoolTopRange(ResourceBaseReqModel req);

    CountResourceInfo selImpalaPoolAllCount(ResourceBaseReqModel req);

    List<CountResourceInfo> selImpalaPoolYcCount(ResourceBaseReqModel req);

    List<CountResourceInfo> selImpalaPoolYc(ResourceBaseReqModel req);

    List<DetailResourceInfo> selImpalaPoolDetail(ResourceBaseReqModel req);

    List<UtilizationImpalaInfo> selImpalaPoolUtilization(ResourceBaseReqModel req);

    List<ImpalaResourceInfo> selImpalaPoolSyl(ResourceBaseReqModel req);

    List<DetailResourceInfo> queryRootPool(@Param("cmFlag") String cmFlag,
                                           @Param("clusterFlag") String clusterFlag);

    String cmImpalaUse(@Param("cmFlag") String cmFlag,
                       @Param("clusterFlag") String clusterFlag);

}
